﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#pragma execution_character_set("utf-8") //解决中文乱码
#pragma once
#include <QMainWindow>
#include "jinchegnxuanse.h"
#include "ui_jinchegnxuanse.h"
#include <windows.h>
#include <QMessageBox>
#include "xiancheng.h"
#include "cunchulianbiao.h"
#include "sasomiaotheard.h"


QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class gengxinThread;


class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    struct Node {
        unsigned long long       dizhiaddress;
        unsigned long long       value;
        unsigned long long       oldvalue;
        Node*                    prev;
        Node*                    next;
    };


    struct sendercanshu {
        unsigned long long jiancha2=1;
        unsigned long long jiancha;
        uint processID;
        int xuhao;
        int guize;
        cunchulianbiao *lianbiao;
    };
    sendercanshu *chancan = new sendercanshu;

    MainWindow(QWidget *parent = nullptr);
    jinchegnxuanse processet;
    gengxinThread gengxin;
    sasomiaotheard * saomiaoth = new sasomiaotheard;

    void _stdcall readprocessmubiao(void * chuancan);
    bool gengxinqidong = 0;
    cunchulianbiao  lianbiao;
    struct  {
        uint processID = 0;
        QString processName;
    }jinchenginfor;

    unsigned long long baseAddress;

    struct
    {
        QString  leixing;
        int xuhao;
        int guize;
    }leixings;
    Ui::MainWindow *ui;
    ~MainWindow(); 



public slots:
    void on_actionjingcheng_triggered();
    void processing();
    void write_treeWidget();
    void updatetreeWidget();

    void on_pushButton_clicked();

    void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);


    void on_treeWidget_2_itemDoubleClicked(QTreeWidgetItem *item, int column);

    //void updatetreeWidget();

    void on_pushButton_2_clicked();

    void on_treeWidget_2_itemChanged(QTreeWidgetItem *item, int column);

    void shanchuxiang();

    void on_treeWidget_2_customContextMenuRequested(const QPoint &pos);

    void on_comboBox_2_currentIndexChanged(int index);

signals:
    void chuandicanshudizhi(void * dizhi);

};

#endif // MAINWINDOW_H
